﻿using Unity.Netcode;
using UnityEngine;
using UnityEngine.Tilemaps;

public class TilemapManager : MonoBehaviour
{
    [SerializeField] private Tilemap tilemap;
    [SerializeField] private TilemapRenderer tilemapRenderer;

    public TileBase[] tiles;


    private void Start()
    {
    }

    private void Update()
    {
    }

    public void SetTile(int x, int y, int tileIndex)
    {
        tilemap.SetTile(new Vector3Int(x, y, 0), tiles[tileIndex]);
        //Debug.Log($"{x},{y},{tileIndex}");
    }

    public void ClearAllTiles()
    {
        tilemap.ClearAllTiles();
    }
}